Developer Documentation

QuickTime 4 API Documentation
QuickTime Music Architecture

| Previous | Chapter Contents | Chapter Top | Next |

Note Allocator Functions: Miscellaneous Interface Tools

The functions in this section provide a user interface for instrument selection and presenting copyright information.

NAPickInstrument

The NAPickInstrument function presents a user interface for picking an instrument.

pascal ComponentResult NAPickInstrument(
                     NoteAllocator na,
                     ModalFilterUPP filterProc,
                     StringPtr prompt,
                     ToneDescription *sd,
                     unsigned long flags,
                     long refCon,
                     long reserved1,
                     long reserved2);
na
You obtain the note allocator identifier from the Component Manager's OpenComponent function. See the chapter "Component Manager" in QuickTime 3 Reference for details.

filterProc
Standard modal filter universal procedure pointer.

prompt
Dialog box prompt "New Instrument".

sd
On entry, the tone description of the instrument that appears in the picker dialog box. On exit, a tone description of the instrument the user selected.

flags
Determines whether to display the picker dialog box and what instruments appear for selection. See "Pick Instrument Flags" .

refcon
Contains a reference constant value. The Movie Toolbox passes this reference constant to your error-notification function each time it calls your function.

reserved1
Must contain zero.

reserved2
Must contain zero.

function result
A result code or -1 if there is a problem opening the dialog box.

DISCUSSION

The flags values limit which instruments appear within the dialog box. If the kPickDontMix flag is set, the dialog box does not display a mix of synthesizer part types. For example, if the current instrument is a drum, only available drums appear in the dialog box. The kPickSameSynth flag allows selections only within the current synthesizer. The kPickUserInsts flag allows user modifiable instruments to appear.

SEE ALSO

NAPickEditInstrument function

NAPickEditInstrument

The NAPickEditInstrument function presents a user interface for changing the instrument in a live note channel or modifying an atomic instrument.

extern pascal ComponentResult NAPickEditInstrument(
                     NoteAllocator na,
                     ModalFilterUPP filterProc,
                     StringPtr prompt,
                     long refCon,
                     NoteChannel nc,
                     AtomicInstrument ai,
                     long flags);
na
You obtain the note allocator identifier from the Component Manager's OpenComponent function. See the chapter "Component Manager" in QuickTime 3 Reference for details.

filterProc
Standard modal filter universal procedure pointer.

prompt
Dialog box prompt "New Instrument".

refCon
Contains a reference constant value. The Movie Toolbox passes this reference constant to your error-notification function each time it calls your function.

nc
The live note channel that appears in the dialog box. If you specify a note channel, set the ai parameter to 0. You obtain the note channel identifier from the NANewNoteChannel or the NANewNoteChannelFromAtomicInstrument function.

ai
The atomic instrument that appears in the dialog box. If you specify an atomic instrument, set the nc parameter to 0. You obtain the atomic instrument from the InstrumentGetInst function.

flags
Flags limiting the instruments presented. See "Pick Instrument Flags"

function result
A result code or -1 if there is a problem opening the dialog box.

DISCUSSION

The flags value limits which instruments appear within the dialog box. If the kPickDontMix flag is set, the dialog box does not display a mix of synthesizer part types. For example, if the current instrument is a drum, only available drums appear in the dialog box. The kPickSameSynth flag allows selections only within the current synthesizer. The kPickUserInsts flag allows user modifiable instruments to appear. If the kPickEditAllowPick flag is not set, no dialog box appears.

SEE ALSO

NAPickInstrument function

NAStuffToneDescription

The NAStuffToneDescription function initializes a tone description structure with the details of a General MIDI note channel.

pascal ComponentResult NAStuffToneDescription(
                     NoteAllocator na,
                     long gmNumber,
                     ToneDescription *td);
na
You obtain the note allocator identifier from the Component Manager's OpenComponent function. See the chapter "Component Manager" in QuickTime 3 Reference for details.

gmNumber
A General MIDI instrument number.

td
On exit, an initialized tone description. The instrument name field will be filled in with the string name for the instrument.

function result
A result code.

NAPickArrangement

The NAPickArrangement function displays a dialog box to allow instrument selection.

pascal ComponentResult NAPickArrangement(
                     NoteAllocator na,
                     ModalFilterUPP filterProc,
                     StringPtr prompt,
                     long zero1,
                     long zero2,
                     Track t,
                     StringPtr songName);
na
You obtain the note allocator identifier from the Component Manager's OpenComponent function. See the chapter "Component Manager" in QuickTime 3 Reference for details.

filterProc
Standard modal filter universal procedure pointer.

prompt
Dialog box prompt.

zero1
Must be 0.

zero2
Must be 0.

t
Arrangement movie track number.

songName
Name of song to display in dialog box.

function result
A result code or -1 if there is a problem opening the dialog box.

NACopyrightDialog

The NACopyrightDialog function displays a copyright dialog box with information specific to a music device.

pascal ComponentResult NACopyrightDialog(
                     NoteAllocator na,
                     PicHandle p,
                     StringPtr author,
                     StringPtr copyright,
                     StringPtr other,
                     StringPtr title,
                     ModalFilterUPP filterProc,
                     long refCon);
na
You obtain the note allocator identifier from the Component Manager's OpenComponent function. See the chapter "Component Manager" in QuickTime 3 Reference for details.

p
Picture image resource handle for dialog box.

author
Author information.

copyright
Copyright information.

other
Any additional information.

title
Title information.

filterProc
Standard modal filter universal procedure pointer.

refcon
Contains a reference constant value. The Movie Toolbox passes this reference constant to your error-notification function each time it calls your function.

function result
A result code or -1 if there is a problem opening the dialog box.


© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |